package vn.igolf.core;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import vn.igolf.geo.Point;

public abstract class ScreenMap extends GolfMap{

	private GolfMap miniMap = new GolfMap();

	public GolfMap getMiniMap() {
		return miniMap;
	}

	public void setMiniMap(GolfMap miniMap) {
		this.miniMap = miniMap;
	}

	public ScreenMap (String filename) {
		File file = new File(filename);
		try {
			Scanner in = new Scanner(file);
			this.setWidth( in.nextInt() );
			this.setLength( in.nextInt() );
			
			this.miniMap.setWidth( in.nextInt() );
			this.miniMap.setLength( in.nextInt() );
			
			while(in.hasNext()) {
				this.getPointList().addPoint( new Point (in.nextInt(), in.nextInt()));
				this.miniMap.getPointList().addPoint( new Point (in.nextInt(), in.nextInt()));
			}
					
		} catch (FileNotFoundException e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}

		
	}
	
	public abstract Point convertMiniPointToScreenPoint (Point miniPoint);
}
